package com.declum.archon.chunkserver.manager.disk;

import java.util.Comparator;

public class FreeDiskSorting implements Comparator<IDiskOperator> {

	@Override
	public int compare(IDiskOperator first, IDiskOperator second) {
		long freeSpaceForFirst = first.getTotalSpace() - first.getUsedSpace();
		long freeSpaceForSecond = second.getTotalSpace()
				- second.getUsedSpace();
		return (int) (freeSpaceForSecond - freeSpaceForFirst);
	}

}
